import axios from 'axios'

const action = {
  getBannerListAction (dispatch) {
    axios.get('http://121.89.205.189/api/banner/list')
    .then(res => {
      dispatch({
        type: 'UPDATE_BANNER_LIST',
        payload: res.data.data
      })
    })
  },
  getProListAction (params) {
    return (dispatch) => {
      axios.get('http://121.89.205.189/api/pro/list', { params })
      .then(res => {
        dispatch({
          type: 'UPDATE_PRO_LIST',
          payload: res.data.data
        })
      })
    }
  }
}

export default action